package com.zy.mc_module.ui.micang.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;

import com.zy.mc_module.base.kotlin.BaseAdapter;
import com.zy.mc_module.base.kotlin.BaseViewHolder;
import com.zy.mc_module.databinding.ItemMineRice1Binding;
import com.zy.mc_module.databinding.ItemMineRiceBinding;
import com.zy.mc_module.mvp.bean.RiceStoreHouseBean;

import java.util.List;

public class MineRice1Adapter extends BaseAdapter<ItemMineRice1Binding, RiceStoreHouseBean> {
    public MineRice1Adapter(@NonNull List<RiceStoreHouseBean> mData) {
        super(mData);
    }

    @NonNull
    @Override
    public ItemMineRice1Binding getViewBinding(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
        return ItemMineRice1Binding.inflate(inflater,parent,false);
    }

    @Override
    protected void onMyBindViewHolder(@NonNull BaseViewHolder<ItemMineRice1Binding> holder, int position) {

        if (holder.getAdapterPosition()%2==0){
            holder.getBinding().mineRiceState.setVisibility(View.GONE);
            holder.getBinding().mineRiceGetTimeLl.setVisibility(View.GONE);
            holder.getBinding().mineRiceGetState.setVisibility(View.VISIBLE);
        }else {
            holder.getBinding().mineRiceState.setVisibility(View.VISIBLE);
            holder.getBinding().mineRiceGetTimeLl.setVisibility(View.VISIBLE);
            holder.getBinding().mineRiceGetState.setVisibility(View.GONE);
        }
    }
}
